<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    *{
      margin: 0;
      padding: 0;
    }
    #box{
      position: absolute;
      left: 0;
      top: 0;
      width: 200px;
      height: 200px;
      background-color: rgba(131, 48, 48, .6);
    }
  </style>
</head>
<body>
  <a href="https://www.baidu.com">点我去百度</a>
  <div id="box"></div>

</body>
</html>
<script>
  // let divNode = document.getElementById('box')
  // divNode.addEventListener('touchstart',function(){
  //   divNode.style.display='none'
  //   console.log(111)
  // })

  // 点透第一步将a标签默认行为杀了
  document.addEventListener('touchstart',(e)=>{
    e.preventDefault()
  },{passive:false})
  // 获取a标签节点
  let aNode = document.querySelectorAll('a')
  aNode.forEach(item=>{
    item.addEventListener('touchstart',function(){
      window.location=this.href
    })
  })
  let divNode = document.getElementById('box')
  divNode.addEventListener('touchstart',function(){
    divNode.style.display='none'
    console.log('div消失法')
  })
</script>